package com.zhangshanfeng.test;

public class Foodie extends Thread {
    @Override
    public void run() {
        while (true){
            //消费者吃
            synchronized (Desk.lock){
                if(Desk.count == 0){
                    break;
                }else {
                    if(Desk.flage){
                        System.out.println("哥哥正在喋鲍鱼");
                        Desk.flage = false;
                        Desk.count--;
                        Desk.lock.notifyAll();

                    }else {
                        try {
                            Desk.lock.wait();
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }

                    }


                }

            }




        }




    }
}
